
public class Tableau {
	
	private int T[];
	
	public Tableau (int T[]){
		this.T=T;
	}
	
	//methode triBulles generique
	public static<A extends Comparable<A>> void triBulles(A[] tab){
		int i = tab.length -2;
		boolean ech=true;
		while (i >=2 && ech){
			ech=false;
			for (int j=0; j<=i; j++){
				if (tab[j].compareTo(tab[j+1])>0){
					A aux = tab[j];
					tab[j]=tab[j+1];
					tab[j+1]=aux;
					ech=true;
				}
			}
			i--;
		}
	}
	
	public void affiche(){
		for (int i=0; i<T.length;i++){
			System.out.print(T[i]+" ");
		}
		System.out.println();
	}
	
	
	/*
	 * FONCTION MAIN 
	*/
	public static void main(String[] args){
		//Integer T[]={10,2,6,11,7,2,-1,0,9};
		Character C[]={'b','h','k','j'};
		Tableau.triBulles(C);
		System.out.print(C);
	}
}
